<?php
header("Content-type:text/html;charset=utf-8");
require_once('inc_admin.php');
if(!empty($_FILES["sqh_pic"]["name"])){
	$pic = uploadfile('sqh_pic','../upload/',array('jpg','gif','png','jpeg'));
}
else{
	$pic='';
}

connect();
$data=array(
	'sqh_title'=>trim($_POST['sqh_title']),
	'sqh_place'=>$_POST['sqh_place'],
	'sqh_pic'=>$pic,
	'sqh_intro'=>$_POST['sqh_intro'],
	'sqh_adddate'=>$_POST['sqh_adddate'],
	//'address'=>$_POST['address']
	);
$result=add('flower',$data);
if(!$result){
	echo "添加失败！<br/>";
	echo "<a href='addflower.html'>返回</a>";
}
else{
	redirect('flowerlist.php','添加成功!');
}

 ?>
